%=============================================================================
%   This program computes the minimum likelihood procedure for the local
%   Whittle estimation of d
%
%   (The only variable here is d, since concentrated)
%
%   Daniela Osterrieder and Peter Schotman
%   The Volatility of Long-term Bond Returns:
%   Persistent Interest Shocks and Time-varying Risk Premiums
%
%   REVIEW OF ECONOMICS AND STATISTICS
%==============================================================================

function R_d = LW_ShiPhi06(d,m,lambda,I)

sumarg=(lambda(1:m,1).^(2*d)).*I(1:m,1);
Ghat=(1/m)*(ones(1,m)*sumarg);
clear j

%Now define the objective function, which depends on d
R_d=log(Ghat)-2*d*(1/m)*(ones(1,m)*log(lambda(1:m)));


